Skip to content

Comments

feat: add asset picker opened and selected metrics#7575

Closed
ghgoodreau wants to merge 8 commits intomainfrom
feat/add-asset-picker-metrics
Closed

feat: add asset picker opened and selected metrics#7575
ghgoodreau wants to merge 8 commits intomainfrom
feat/add-asset-picker-metrics

Conversation

@ghgoodreau
Copy link
Contributor

@ghgoodreau ghgoodreau commented Jan 7, 2026

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

High Risk
Includes breaking API/state changes (assetsMetadataassetsInfo, AI digest actions removed) and substantial behavior changes in asset fetching/subscriptions that can affect downstream clients and persisted state.

Overview
Upgrades the monorepo’s Jest toolchain to v29 (switching scripts/ tests from babel-jest to ts-jest, adding uuid mapping, updating depcheck ignores) and bumps many packages’ dev deps accordingly, plus increases ESLint memory for CI stability.

Extends @metamask/assets-controller with new data/state and runtime behavior toggles: renames assetsMetadataassetsInfo (breaking), adds RPC-only vs API-enabled mode via isBasicFunctionality + subscription refresh, introduces a StakedBalanceDataSource to merge staked balances, and adds a trackMetaMetricsEvent callback that reports first post-unlock fetch duration (including per-data-source timing).

Updates @metamask/ai-controllers to focus on market insights: replaces legacy digest APIs/state/actions with fetchMarketInsights backed by searchDigest(caip19Id), adds CAIP-19 validation, normalizes/validates API responses (including digest-envelope format), and adjusts caching/eviction behavior and tests.

Written by Cursor Bugbot for commit e2f5d96. This will update automatically on new commits. Configure here.

@ghgoodreau ghgoodreau requested a review from a team as a code owner January 7, 2026 16:49
@ghgoodreau ghgoodreau marked this pull request as draft January 7, 2026 16:49
@ghgoodreau ghgoodreau marked this pull request as ready for review February 10, 2026 15:18
@ghgoodreau ghgoodreau requested a review from a team as a code owner February 10, 2026 16:03
@ghgoodreau ghgoodreau requested review from a team as code owners February 18, 2026 19:37
@ghgoodreau ghgoodreau closed this Feb 18, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

this.#priceDataSource.assetsMiddleware,
],
const { response: enrichedResponse } = await this.#executeMiddlewares(
[this.#detectionMiddleware, this.#tokenDataSource, this.#priceDataSource],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleAssetsUpdate ignores isBasicFunctionality for enrichment middlewares

Medium Severity

handleAssetsUpdate always runs TokenDataSource and PriceDataSource enrichment middlewares regardless of isBasicFunctionality(). In contrast, getAssets correctly excludes these API-based sources when basic functionality is off (RPC-only mode). This means when an RPC data source pushes a balance update via its subscription callback, the enrichment path still makes external API calls for token metadata and prices, violating the RPC-only contract that isBasicFunctionality is meant to enforce.

Additional Locations (1)

Fix in Cursor Fix in Web

handleBasicFunctionalityChange(_isBasic: boolean): void {
this.#stop();
this.#subscribeAssets();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleBasicFunctionalityChange skips immediate data refresh unlike #start

Medium Severity

handleBasicFunctionalityChange calls #stop() then #subscribeAssets(), but unlike #start() it does not call getAssets(..., { forceUpdate: true }). When the user toggles basic functionality (e.g., switching from RPC-only to full API mode), subscriptions are recreated with the correct data source set, but no immediate fetch is triggered. Users see stale data from the previous mode until the next polling cycle fires.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant